package com.etc.log;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.stereotype.Component;

@Aspect
@Component
@EnableAspectJAutoProxy(proxyTargetClass=true)
public class Log {
	@Pointcut(value="execution(* com.etc.service.*.*(..))")
	public void test() {
		
	}
	@Before(value="test()")
	public void before() {
		System.out.println("*******Before******");
	}
	@After(value="test()")
	public void after() {
		System.out.println("*******after******");
	}
	@Around(value="test()")
	public Object around(ProceedingJoinPoint pjp) throws Throwable {
		System.out.println("*******around  Before******");
		Object result=pjp.proceed();
		System.out.println("*******around  after******");
		return result;
	}
	
	
}
